/* 
 * Copyright (C) 2004-2005 Jonathan Bindel
 * Copyright (C) 2006-2007 Eskil Bylund
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

using System;
using System.Xml.Serialization;

using DCSharp.Backend.Connections;

namespace DCSharp.Backend.Objects
{
	public class FavoriteHubEventArgs : EventArgs
	{
		private FavoriteHubInfo hubInfo;

		public FavoriteHubEventArgs(FavoriteHubInfo hubInfo)
		{
			this.hubInfo = hubInfo;
		}

		public FavoriteHubInfo FavoriteHubInfo
		{
			get { return hubInfo; }
		}
	}

	public class FavoriteHubInfo
	{
		private string name;
		private string description;
		private string hostname;
		private string encoding;
		private bool autoConnect;

		private string nick;
		private string password;
		private string userDescription;

		public FavoriteHubInfo(string name, string hostname) : this()
		{
			this.name = name;
			this.hostname = hostname;
		}

		public FavoriteHubInfo()
		{
			autoConnect = true;
		}

		#region Properties

		[XmlAttribute("Connect")]
		public bool AutoConnect
		{
			get { return autoConnect; }
			set { autoConnect = value; }
		}

		#region Hub Details

		[XmlAttribute]
		public string Name
		{
			get { return name; }
			set { name = value; }
		}

		[XmlAttribute]
		public string Description
		{
			get { return description; }
			set { description = value; }
		}

		[XmlAttribute("Server")]
		public string Hostname
		{
			get { return hostname; }
			set { hostname = value; }
		}

		[XmlAttribute]
		public string Encoding
		{
			get { return encoding; }
			set { encoding = value; }
		}

		#endregion

		#region User Details

		[XmlAttribute]
		public string Nick
		{
			get { return nick; }
			set { nick = value; }
		}

		// TODO: Password encryption.
		[XmlAttribute]
		public string Password
		{
			get { return password; }
			set { password = value; }
		}

		public string UserDescription
		{
			get { return userDescription; }
			set { userDescription = value; }
		}

		#endregion

		#endregion
	}
}
